package com.seal.tsms.system.entity;

import javax.persistence.*;

/**
 * Created by seal.jing on 2016/1/2.
 */
@Entity
@Table(name = "SYS_ROLE_PERMISSION")
@IdClass(RolePermissionPk.class)
public class RolePermission {
    private SystemRole role;
    private SystemPermission permission;

    @Id
    @ManyToOne()
    @JoinColumn(name = "ROLE_ID")
    public SystemRole getRole() {
        return role;
    }

    public void setRole(SystemRole role) {
        this.role = role;
    }

    @Id
    @ManyToOne()
    @JoinColumn(name = "PERMISSION_ID")
    public SystemPermission getPermission() {
        return permission;
    }

    public void setPermission(SystemPermission permission) {
        this.permission = permission;
    }
}
